﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DD_Extensions
{
    public partial class _LogOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            Session.Abandon();
            System.Web.HttpContext chc = System.Web.HttpContext.Current;
            String strUser = chc.User.Identity.Name;

            // clear cache if any
            if (chc.Cache[strUser] == null)
            {
            }
            else
            {
                chc.Cache.Remove(strUser);
            }

            System.Web.Security.FormsAuthentication.SignOut();
            Response.Redirect("LoggedOut.htm", true);
            // ? do we need to do this ?  Response.End();
            // Probably not because the second argument (true) of Response.Redirect handles that

        }
    }
}